package com.whh.permission.service.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whh.permission.dao.IAssetDao;
import com.whh.permission.po.Asset;
import com.whh.permission.po.Asset;
import com.whh.permission.service.IAssetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class AssetServiceImpl implements IAssetService {
    @Resource
    private IAssetDao iAssetDao;

    @Override
    public PageInfo<Asset> findAssetAll(int page, int pageSize, Asset asset) {
        PageHelper.startPage(page,pageSize);//分页
        //查询所有用户信息
        List<Asset> assets = iAssetDao.queryAssetAll(asset);
        PageInfo<Asset> assetPageInfo = new PageInfo<>(assets);
        return assetPageInfo;
    }

    @Override
    public Asset queryAssetById(Integer id) {
        return iAssetDao.queryAssetById(id);
    }



    @Override
    public void addAsset(Asset asset) {
        iAssetDao.addAsset(asset);
    }

    @Override
    public void updateAsset(Asset asset) {
        iAssetDao.updateAsset(asset);
    }

    @Override
    public void deleteAssetByIds(List<Integer> ids) {
        iAssetDao.deleteAssetByIds(ids);
    }

}
